import service from "@/service/http.interceptor";

/**
 * 获取推荐列表
 */
export const getPointRecommendList = (params) => {
	return service.request({
		method: 'get',
		url: '/shop/point/spu/c/getPointRecommendList',
		params,
		custom: {
			loading: true
		}
	})
}

/**
 * c端获取所有积分商城分类
 */
export const getPointSpuCategoryList = (params) => {
	return service.request({
		method: 'get',
		url: '/shop/point/spu/category/c/getPointSpuCategoryList',
		params,
		custom: {
			loading: true
		}
	})
}

/**
 * 分页获取所有积分商城商品
 */
export const getPointSpuPageByCategoryId = (params) => {
	return service.request({
		method: 'get',
		url: '/shop/point/spu/c/getPointSpuPage',
		params,
		custom: {
			loading: true
		}
	})
}

/**
 * 获取积分商城商品详情
 */
export const getPointSpuDetail = (params) => {
	return service.request({
		method: 'get',
		url: '/shop/point/spu/c/getPointSpuDetail',
		params,
		custom: {
			loading: true
		}
	})
}

/**
 * 创建积分商城订单
 */
export const create = (data) => {
	return service.request({
		method: 'post',
		url: '/shop_order/point/spu/order/c/create',
		data,
		custom: {
			loading: true
		}
	})
}

/**
 * 创建积分商城订单
 */
export const userPointChangePage = (params) => {
	return service.request({
		method: 'get',
		url: '/shop_user/user/point/change_record/c/userPointChangePage',
		params,
		custom: {
			loading: true
		}
	})
}


/**
 * 获取积分订单列表
 */
export const getPointOrderPage = (params) => {
	return service.request({
		method: 'get',
		url: '/shop_order/point/spu/order/c/page',
		params,
		custom: {
			loading: true
		}
	})
}


/**
 * 获取订单详情
 */
export const getPointOrderInfo = (params) => {
	return service.request({
		method: 'get',
		url: `/shop_order/point/spu/order/c/orderInfo/${params.orderId}`,
		params,
		custom: {
			loading: true
		}
	})
}


/**
 * 订单签收
 */
export const orderSignFor = (data) => {
	return service.request({
		method: 'post',
		url: `/shop_order/point/spu/order/c/orderSingFor`,
		data,
		custom: {
			loading: true
		}
	})
}